package scau.erps.service.impl;

import org.nutz.service.IdEntityService;

import scau.erps.entity.Sand;
import scau.erps.service.SandService;
import scau.erps.util.CalculateQuarter;

/**
 * 沙盘盘面数据服务实现类
 * @author DCJ
 *
 */
public class SandServiceImpl  extends IdEntityService<Sand> implements SandService {

	/**
	 * 根据ID查找沙盘数据
	 * @param team_Id
	 * @return
	 */
	@Override
	public Sand getSandByTeam(int team_Id) {
		return this.fetch(team_Id);
	}

	/**
	 * 更新沙盘数据
	 * @param team_Id
	 * @return
	 */
	@Override
	public void updateSand(Sand sand) {
		this.dao().update(sand);
		
	}
	/**
	 * 清除综合费用
	 * @param team_Id
	 * @return
	*/
	@Override
	public void clearCost(int team_Id) {
		Sand sand = this.getSandByTeam(team_Id);
		sand.setAdvertisingFee(0);
		sand.setDepreciation(0);
		sand.setDiscount(0);
		sand.setInterest(0);
		sand.setMaintenanceFee(0);
		sand.setOther(0);
		sand.setRent(0);
		sand.setSwitchFee(0);
		sand.setTax(0);	
		sand.setManagementFee(0);
		this.updateSand(sand);		
	}
	 
}
